<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:th="http://www.thymeleaf.org">
<head th:with="path=${path}">
    <meta charset="utf-8"/>
    <title>BPMN在线作图工具</title>
    <meta name="viewport" content="width=device-width,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="keywords" content="bpmn，activiti，工作流，作图工具，bpmn-js"/>
    <meta name="description" content="世界上最好的BPMN在线作图工具"/>
    <meta name="author" content="小柒2012" />
    <meta name="site" content="https://blog.52itstyle.vip" />
    <link th:href="@{flat_ui/css/vendor/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{flat_ui/css/flat-ui.css}" rel="stylesheet"/>
    <script th:src="@{/libs/jquery-3.2.1.min.js}" type="text/javascript"></script>
	<script th:src="@{/libs/vue.min.js}" type="text/javascript"></script>
	<script th:src="@{/layer/layer.js}" type="text/javascript"></script>
	<script th:src="@{/common.js}" type="text/javascript"></script>
</head>
<body>
<div class="container" style="margin-top: 1%;" v-cloak id="app">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="login">
                <div class="login-screen">
                    <div class="login-icon">
                        <a target="_blank" href="https://blog.52itstyle.vip" class="text-warning"><h5>工作流</h5></a>
                    </div>
                    <div class="login-form">
                            <div class="control-group">
                                <input type="text" name="username" class="login-field form-control" id="username"
                                       placeholder="请输入用户名"  v-model="username" 
                                       required="required" maxlength="255"   autocomplete="off"/>
                                       
                                <label class="login-field-icon fui-user" for="username"></label>
                            </div>
                            <div class="control-group">
                                <input type="password" name="password"  class="login-field form-control" id="password"
                                       placeholder="请输入密码"  v-model="password"
                                       required="required" maxlength="255"/>
                                <label class="login-field-icon fui-lock" for="password"></label>
                            </div>
                            <button  class="btn btn-primary btn-large btn-block"  @click="login" >登陆</button>
                            <span class="text-danger pull-right" style="font-size: 13px;margin-top: 15px;">
                            </span>
                            <a class="login-link" target="_blank" href="https://blog.52itstyle.vip">&raquo; 注册</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
	$(function () {	
		var vm = new Vue({
			el: '#app',
			data:{
				username: 'admin',
				password: 'admin',
			},
			methods: {
				login: function (event) {
					if(vm.username==""){
						vm.error = true;
						vm.errorMsg ="请输入用户名";
						return false;
					}else if(vm.password==""){
						vm.error = true;
						vm.errorMsg ="请输入密码";
						return false;
					}
					var self = this;
					var data = "username="+vm.username+"&password="+vm.password;
					$.ajax({
						type: "POST",
					    url: "login",
					    data: data,
					    dataType: "json",
					    success: function(result){
							if(result.code == 0){//登录成功
								parent.location.href ='main.shtml';
							}else{
								pop.info(result.msg)
							}
						}
					});
				},
			},
			created: function(){
				
			}
		});						
	});
</script>
</body>
</html>